package com.example.restfull.bean;

import com.example.restfull.validator.UserNameConstraint;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Past;
import java.util.Date;

/***
 Created by grantwoo at 10/18/18 10:16 PM

 */
public class UserInfo {

    private int id;

    @UserNameConstraint
    private String username;

    @Length(min = 5,max = 25)
    private String password;

    @Range(max = 200)
    private int age;

    @Range(max=2)
    private int sex;

    @Past
    private Date birthday;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
}
